import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/material.dart' hide Action;
import 'view.dart';

import 'action.dart';
import 'state.dart';

Reducer<PersonListState> buildReducer() {
  return asReducer(
    <Object, Reducer<PersonListState>>{
      PersonListAction.changeTabListAction: _onInItController,
    },
  );
}

//初始化controller控制
PersonListState _onInItController(PersonListState state, Action action) {
  TabController controller =action.payload["controller"] ?? null;
  final PersonListState newState = state.clone();
  newState.controller = controller;
  return newState;
}
